Skip to main content
ik_llama.cpp has a minimal set of dependencies: cmake, a C++17-capable compiler, and — for GPU builds — the CUDA toolkit. All are available from the system package manager on Linux.
The only fully supported and performant backends are CPU (AVX2/ARM NEON) and CUDA. Metal, ROCm/hipBLAS, and Vulkan are inherited from the llama.cpp upstream but are not actively maintained in this fork. Issues with those backends will only be resolved if contributors step up to fix them.

Prerequisites

Get the source:

CMake build

CMake is the recommended build method on all platforms.
On macOS, Metal is enabled by default. To disable it:

Important CMake flags

Detects your CPU’s feature set at compile time (AVX2, AVX-512, ARM NEON, etc.) and generates optimised code for it. Highly recommended for local builds. Omit this flag if you need a portable binary that runs on older CPUs.
Enables the CUDA backend for Nvidia GPU acceleration. Requires the CUDA Toolkit to be installed.
Limits CUDA compilation to specific GPU compute capabilities, dramatically reducing build time. Common values:Example: -DCMAKE_CUDA_ARCHITECTURES=86
Compiles support for all KV cache quantization type combinations in the Flash Attention CUDA kernels. Enables more fine-grained control over KV cache size (e.g. using IQ4_K for K-cache and IQ3_K for V-cache together with Flash Attention). Significantly increases compilation time.
Enables the RPC backend, which allows offloading compute to a remote machine. Useful in distributed or heterogeneous multi-machine setups.
Disables NCCL (NVIDIA Collective Communications Library) support. NCCL is off by default; set this explicitly if your environment has NCCL installed and you want to avoid linking it.
Enables SQLite3 support in llama-server, required for the mikupad alternative web UI. Make sure libsqlite3-dev (or equivalent) is installed before configuring.
For single-config generators (default on Linux/macOS):
For multi-config generators (Visual Studio, Xcode):

Windows build

The following is a step-by-step walkthrough for a successful Windows CUDA build using clang-cl via Visual Studio Build Tools.
1

Install CUDA Toolkit and Visual Studio Build Tools

  • Download CUDA 12.6 from Nvidia. During installation, select custom setup and uncheck Driver components and PhysX (not needed in a VM).
  • Download Visual Studio Build Tools 2022. During setup, go to the Individual components tab, search for clang, and add the clang-related tools (they are not selected by default).
2

Clone the repository

Download Portable Git and clone:
3

Set up environment variables

4

Configure with CMake

Adjust -DCMAKE_CUDA_ARCHITECTURES to match your GPU and /clang:-march= to match your CPU:
Use forward slashes (/) in all cmake paths on Windows. Backslashes can be misinterpreted by CMake as escape characters.
5

Build

6

Copy CUDA runtime DLLs

Copy the following DLLs from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin to C:\Downloads\output\bin:
  • cublas64_12.dll
  • cublasLt64_12.dll
  • cudart64_12.dll
Also copy libomp140.x86_64.dll from C:\Windows\System32\ to the same output bin directory.

BLAS acceleration

Building with BLAS support can improve prompt processing throughput for large batch sizes (above 32 tokens). It does not affect token generation speed on CPU-only builds.
Make sure libopenblas-dev (or equivalent) is installed first.
Source the oneAPI environment and then build:
If you are using the oneAPI-basekit Docker image, you can skip the setvars.sh step.
Accelerate is enabled by default on macOS — no extra flags are needed. Use the standard CMake build instructions.

hipBLAS / ROCm

The ROCm/hipBLAS backend is not actively maintained in ik_llama.cpp. Use it at your own risk.
Install ROCm first. Then build, specifying your AMD GPU target:
Find your GPU target with:
To enable Unified Memory Architecture (UMA) for APUs or integrated GPUs (hurts performance on discrete GPUs):
The environment variable HIP_VISIBLE_DEVICES selects which GPU(s) to use at runtime. If your GPU is not officially supported, try setting HSA_OVERRIDE_GFX_VERSION to a similar architecture (e.g. 10.3.0 for RDNA2, 11.0.0 for RDNA3).

Vulkan

The Vulkan backend is not actively maintained in ik_llama.cpp. Use it at your own risk.
Install the Vulkan SDK:
Then build: